import request from '@/utils/request'

// 查询产品退货入库开单作业列表
export function listRhmTh(query) {
  return request({
    url: '/putStorage/rhmTh/list',
    method: 'get',
    params: query
  })
}

// 查询产品退货入库开单作业详细
export function getRhmTh(rhmId) {
  return request({
    url: '/putStorage/rhmTh/' + rhmId,
    method: 'get'
  })
}

// 新增产品退货入库开单作业
export function addRhmTh(data) {
  return request({
    url: '/putStorage/rhmTh',
    method: 'post',
    data: data
  })
}

// 修改产品退货入库开单作业
export function updateRhmTh(data) {
  return request({
    url: '/putStorage/rhmTh',
    method: 'put',
    data: data
  })
}

// 删除产品退货入库开单作业
export function delRhmTh(rhmId) {
  return request({
    url: '/putStorage/rhmTh/' + rhmId,
    method: 'delete'
  })
}

// 导出产品退货入库开单作业
export function exportRhmTh(query) {
  return request({
    url: '/putStorage/rhmTh/export',
    method: 'get',
    params: query
  })
}


//查询符合条件的明细
export function getMx(query) {
  return request({
    url: '/putStorage/rhmTh/getRhdMx',
    method: 'get',
    params: query
  })
}

//添加明细数据
export function addMx(data) {

  return request({
    url: '/putStorage/rhmTh/addRhdMx',
    method: 'post',
    data: data
  })

}

//根据单号获取明细数据
export function getOrderByDjbh(query) {
  return request({
    url: '/putStorage/rhmTh/getRhdMxByRhmDjbh/' + query,
    method: 'get'
  })
}

//根据单号/物料代码进行删除
export function deleteMxByCondition(order,wldm) {
  return request({
    url: '/putStorage/rhmTh//deleteRhdByCondition/' + order+"/"+wldm,
    method: 'delete'
  })
}

// 根据退货单号提交明细单据
export function submitMx(order) {
  return request({
    url: '/putStorage/rhmTh//submitMx/' + order,
    method: 'put'
  })
}


//导出明细
export function exportRhmThMx(query) {
  return request({
    url: '/putStorage/rhmTh/exportMx/'+query,
    method: 'get',
  })
}

//检验结果
export function testResult(param1,param2,param3,param4,param5,param6) {
  return request({
    url: '/putStorage/rhmTh/testMx/'+param1+"/"+param2+"/"+param3+"/"+param4+"/"+param5+"/"+param6,
    method: 'put',
  })
}

//撤回接口
export function rollback(order,desc) {
  return request({
    url: '/putStorage/rhmTh/backMx/'+order+"/"+desc,
    method: 'put',
  })
}

//审核接口
export function check(order) {
  return request({
    url: '/putStorage/rhmTh/checkMx/'+order,
    method: 'put',
  })
}

//入库确认接口
export function rkConfirm(order,wldm,count) {
  return request({
    url: '/putStorage/rhmTh/rkMx/'+order+"/"+wldm+"/"+count,
    method: 'put',
  })
}

//过账接口
export function post(order) {
  return request({
    url: '/putStorage/rhmTh/finishMx/'+order,
    method: 'put',
  })
}
